package com.xgc.book.bookserver.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xgc.book.bookserver.bean.BookCategoryBean;
import com.xgc.book.bookserver.mapper.BookCategoryMapper;
import com.xgc.book.bookserver.service.BookCategoryService;
import com.xgc.book.bookserver.util.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 图书分类表 服务实现类
 * </p>
 *
 * @author wrz
 * @since 2023-11-20
 */
@Service
@Transactional
public class BookCategoryServiceImpl extends ServiceImpl<BookCategoryMapper, BookCategoryBean> implements BookCategoryService {
    @Autowired
    private BookCategoryMapper bookCategoryMapper;


    @Override
    public ResultJson getBookPageByCategoryId(int page, int limit, int categoryId) {
        return ResultJson.ok(bookCategoryMapper.getBookByCategoryId(new Page<>(page, limit), categoryId));
    }
}
